//
//  AIFGetOrderInfoManager.m
//  PywSdk
//
//  Created by Jade on 16/11/19.
//  Copyright © 2016年 Jade. All rights reserved.
//

#import "AIFGetOrderInfoManager.h"
#import "PywCipherUtils.h"

@implementation AIFGetOrderInfoManager
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.child = self;
        self.paramSource = self;
        self.validate = self;
    }
    return self;
}


#pragma mark - ETAPIManager
- (NSString *)methodName{
    return URL_SECONDEINIT;
}

- (ETAPIManagerRequestType)requestType{
    return ETAPIManagerRequestTypePost;
}


- (NSString *)seriviceType{
    return [PywAppInfo sharedAppInfo].seriviceType;
}

#pragma mark - ETAPIManagerParamSourceDelegate
- (NSDictionary *)paramsForApi:(ETApiBaseManager *)manager{
    
    MutableDictionary *param = [[MutableDictionary alloc] init];
    NSString *account = [PywPlatformMain sharedPlatformMain].account;
    NSString *gamekey = [PywAppInfo sharedAppInfo].gameKey;
    NSString *gameid = [PywAppInfo sharedAppInfo].gameId;
    NSString * tid = [PywAppInfo sharedAppInfo].tid;
    NSString *apiSeret2 = [AppUtil getApiSecret2:tid apiSecret:[PywAppInfo sharedAppInfo].apisecret];
    NSString *sign = [PywCipherUtils md5:[NSString stringWithFormat:@"%@%@",account,apiSeret2]];
    
    [param setObject:tid forKey:@"tid"];
    [param setObject:sign forKey:@"sign"];
    [param setObject:gameid forKey:@"gameid"];
    [param setObject:account forKey:@"account"];
    [param setObject:gamekey forKey:@"gamekey"];
    return param;
}

#pragma mark - ETAPIManagerValidator
- (BOOL)manager:(ETApiBaseManager *)manager isCorrectWithParamsData:(NSDictionary *)data{
    return YES;
}

- (BOOL)manager:(ETApiBaseManager *)manager isCorrectWithCallBackData:(NSDictionary *)data{
    return YES;
}

@end
